<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 

<div class="nav-collapse">
    <ul class="nav">  
        <li>
            <html:link action="/getFriendList" onmouseover="document.getElementById('namigos').style.visibility = 'visible'" onmouseout="document.getElementById('namigos').style.visibility = 'hidden'">
                <div>
                    <c:choose>
                        <c:when test="${contador[0] == 0}">
                            <button class="btn btn-mini"><i class="icon-user"></i>&nbsp;&nbsp;<bean:message key="amigos.txt"/></button>                    
                        </c:when>
                        <c:otherwise>
                            <button class="btn btn-mini btn-primary"><i class="icon-user"></i>&nbsp;&nbsp;<bean:message key="amigos.txt"/></button>                    
                            <logic:present name="notificaciones">
                                <div id="namigos" class="well well-large span3" style="visibility: hidden; position: absolute; color:black;">
                                    <logic:iterate id="lista" name="notificaciones">
                                        <c:choose>
                                            <c:when test="${lista.tipos.idtipo < 3}">
                                                <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/><br/>
                                                <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                                            </c:when>
                                        </c:choose>
                                    </logic:iterate>
                                </div>
                            </logic:present>
                        </c:otherwise>
                    </c:choose>
                </div>
            </html:link>
        </li>
        <li>
            <html:link action="/getMessageList" onmouseover="document.getElementById('nmensajes').style.visibility = 'visible'" onmouseout="document.getElementById('nmensajes').style.visibility = 'hidden'">
                <div>
                    <c:choose>
                        <c:when test="${contador[1] == 0}">
                            <button class="btn btn-mini"><i class="icon-envelope"></i>&nbsp;&nbsp;<bean:message key="mensajes.txt"/></button>                                                
                        </c:when>
                        <c:otherwise>
                            <button class="btn btn-mini btn-warning"><i class="icon-envelope"></i>&nbsp;&nbsp;<bean:message key="mensajes.txt"/></button>                                                
                            <logic:present name="notificaciones">
                                <div id="nmensajes" class="well span3" style="visibility: hidden; position: absolute; color:black;">
                                    <logic:iterate id="lista" name="notificaciones">
                                        <c:choose>
                                            <c:when test="${lista.tipos.idtipo == 3}">
                                                <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/><br/>
                                                <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                                            </c:when>
                                        </c:choose>
                                    </logic:iterate>
                                </div>
                            </logic:present>
                        </c:otherwise>
                    </c:choose>
                </div>
            </html:link>
        </li>
        <li>
            <html:link action="/myExercises?noti=si"  onmouseover="document.getElementById('nejercicios').style.visibility = 'visible'" onmouseout="document.getElementById('nejercicios').style.visibility = 'hidden'">
                <div>
                    <c:choose>
                        <c:when test="${contador[2] == 0}">
                            <button class="btn btn-mini"><i class="icon-file"></i>&nbsp;&nbsp;<bean:message key="ejercicios.txt"/></button>                                                
                        </c:when>
                        <c:otherwise>
                            <button class="btn btn-mini btn-danger"><i class="icon-file"></i>&nbsp;&nbsp;<bean:message key="ejercicios.txt"/></button>                                                
                            <logic:present name="notificaciones">
                                <div id="nejercicios" class="well well-large span3" style="visibility: hidden; position: absolute; color:black;">
                                    <logic:iterate id="lista" name="notificaciones">
                                        <c:choose>
                                            <c:when test="${lista.tipos.idtipo > 4}">
                                                <bean:write name="lista" property="usuariosByIdemisor.alias" /> <bean:write name="lista" property="tipos.tipo"/><br/>
                                                <bean:write name="lista" property="fecha" format="hh:mm dd/MM/yyyy"/><br/>
                                            </c:when>
                                        </c:choose>
                                    </logic:iterate>
                                </div>
                            </logic:present>
                        </c:otherwise>
                    </c:choose>
                </div>
            </html:link>
        </li>
    </ul>
</div>